import 'package:meta/meta.dart';

@immutable
class CountState {
  int _count;

  get count => _count;

  CountState(this._count);

  CountState.initState() : _count = 0;
}

/**
 * 定义操作该State的全部Aciton
 * 这里只有增加count一个动作
 */
enum Action { increment }

CountState reducer(CountState state, action) {
  if (action == Action.increment) return CountState(state.count + 1);
  return state;
}
